package com.example.robotwatcher.backend;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import org.bytedeco.javacv.AndroidFrameConverter;
import org.bytedeco.javacv.Frame;
import org.bytedeco.javacv.OpenCVFrameConverter;
import org.bytedeco.opencv.opencv_core.IplImage;

public class VideoDecode {
    public static Bitmap ConvertToBitmap(Frame frame)
    {
//        OpenCVFrameConverter.ToIplImage converter = new OpenCVFrameConverter.ToIplImage();
//        IplImage result = converter.convert(frame);
        AndroidFrameConverter frameConverter = new AndroidFrameConverter();
        Bitmap bitmap = frameConverter.convert(frame);
        return bitmap;
    }
}
